﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class MyPlayer : MonoBehaviour
{
    Rigidbody2D rb;
    Collider2D colliderM;
    void Start()
    {
        rb = GetComponent<Rigidbody2D>();
        colliderM = GetComponent<Collider2D>();
    }


    // Update is called once per frame
    void Update()
    {
        //玩家移动
        float H = Input.GetAxis("Horizontal") * Time.deltaTime * 100f;
        float V = Input.GetAxis("Vertical") * Time.deltaTime * 100f;
        rb.velocity = new Vector2(H, V);

        //OnCollisionEnter(colliderM);
    }
   //void OnCollisionEnter(Collider2D collider)
   //{
   //    if (collider.gameObject.tag=="MT")
   //    {
   //        Application.Quit();
   //    }
   //}
}
